import Api from '@/api'
import config from '@/config'

export default class HomeService {
    async token (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.token,
            data,
            headers
        })
    }

    async push (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.push,
            data,
            headers
        })
    }

    async notice (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.notice,
            data,
            headers
        })
    }
    //详情
    async info (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.info,
            data,
            headers
        })
    }
    //获取用户发布的历史记录信息
    async history (data = {}, headers = {}) {
        console.log(1)
        console.log("data",data)
        return await (new Api).post({
            url: config.apiList.history,
            data,
            headers
        })
    }
    //修改 失物招领 和 寻物启事 的状态
    async changeStatus (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.changeStatus,
            data,
            headers
        })
    }

    async tab (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.tab,
            data,
            headers
        })
    }

    async uploadFile (data = {}, headers = {}) {
        return await (new Api("noBaseUrl")).post({
            url: config.aliOss.host,
            data,
            headers
        })

    }

    async trigger(data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.search,
            data,
            headers
        })
    }
}